import { ApiProperty } from '@nestjs/swagger';
import { UserRole } from '../../common/enums';
import { DeviceUserModel } from '../../devices/models/device-user.model';
import { DeviceAdminModel } from '../../devices/models';

export class UserResponseDto {
  @ApiProperty({ description: '用户ID' })
  id: string;

  @ApiProperty({ description: '用户名' })
  username: string;

  @ApiProperty({ description: '显示名称' })
  displayName: string;

  @ApiProperty({ description: '手机号' })
  phone: string;

  @ApiProperty({ description: '用户角色', enum: UserRole })
  role: UserRole;

  @ApiProperty({ description: '是否激活' })
  isActive: boolean;

  @ApiProperty({ description: '最后登录时间' })
  lastLoginAt: Date;

  @ApiProperty({ description: '创建时间' })
  createdAt: Date;

  @ApiProperty({ description: '设备列表', type: [DeviceUserModel] })
  devices: DeviceUserModel[];
}

export class UserAdminResponseDto extends UserResponseDto {
  @ApiProperty({ description: '设备列表', type: [DeviceAdminModel] })
  devices: DeviceAdminModel[];
}
